package com.jingle.tutorial;

import java.util.ArrayList;
import java.util.Random;

import com.jingle.tutorial.other.CarMaster;

public class CarFactory
{

	
	
	
	public static ArrayList<CarMaster> modifyCar(ArrayList<CarMaster> carMasterList)
	{
		CarAttributeCache.setRand(new Random(System.currentTimeMillis()));
		
		for(CarMaster carMaster : carMasterList)
		{
			String model = null;
			String make = PickRand.getRandom(CarAttributeCache.getMakes());
			if (make == "Ford") {
				model = PickRand.getRandom(CarAttributeCache.getFords());
			} else if (make == "Toyota") {
				model = PickRand.getRandom(CarAttributeCache.getToyotas());
			} else if (make == "Chevy") {
				model = PickRand.getRandom(CarAttributeCache.getChevys());
			} else if (make == "Jeep") {
				model = PickRand.getRandom(CarAttributeCache.getJeeps());
			} else if (make == "Dodge") {
				model = PickRand.getRandom(CarAttributeCache.getDodges());
			}
			
			carMaster.setMake(make);
			carMaster.setModel(model);
			carMaster.setColor(PickRand.getRandom(CarAttributeCache.getColors()));
			carMaster.setPimpLevel(PickRand.getRandom(CarAttributeCache.getPimplevelarray()));
		}
		
		return carMasterList;
	}
}
